package com.fortune.rainshine.feign.service;

import com.fortune.rainshine.config.FeignConfig;
import com.fortune.rainshinecommon.base.MsgModel;
import com.fortune.rainshinecommon.base.ParmsModel;
import com.fortune.rainshinecommon.model.service.OrderModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@FeignClient(value = "rain-shine-service",configuration = FeignConfig.class)
@Controller
public interface OrderFeign {
    /**
     * 订单列表
     * @param parm
     * @return
     */
    @PostMapping("/order/list")
    @ResponseBody
    MsgModel productList(@RequestBody ParmsModel parm);

    /**
     * 确认出货
     * @param model
     * @return
     */
    @PostMapping("/order/confirming")
    @ResponseBody
    MsgModel confirmingAnOrder(@RequestBody OrderModel model);

    /**
     * 查看订单详情
     * @param orderModel
     * @return
     */
    @PostMapping("/order/getOrderDetail")
    @ResponseBody
    MsgModel getOrderDetail(@RequestBody OrderModel orderModel);

    @PostMapping("/order/getByOrderCode")
    @ResponseBody
    OrderModel getByOrderCode(@RequestBody String orderCode);

    /**
     * 确认收货
     * @param id
     * @return
     */
    @PostMapping("/order/receiving")
    @ResponseBody
    MsgModel receivingAnOrder(@RequestBody OrderModel model);

    /**
     * 买方取消订单/卖方拒绝订单
     * @param orderModel
     * @return
     */
    @PostMapping("/order/cancelOrder")
    @ResponseBody
    MsgModel cancelOrder(@RequestBody OrderModel orderModel);
}
